package plantshop.tests;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import plantshop.model.Customer;
import plantshop.model.CustomerYComparator;
import plantshop.model.Location;

public class CustomerYComparatorTest
{
	static Customer c1;
	static Customer c2;
	static Customer c3;
	@BeforeClass
	public static void setUpBeforeClass() throws Exception
	{
		Customer.setEntrance(new Location(0, 0));
		Customer.setExit(new Location(1920, 1080));
		Customer.setXScale(1);
		Customer.setYScale(1);
		
		c1 = Customer.makeCustomer();
		c1.setLoc(new Location(100, 100));
		c2 = Customer.makeCustomer();
		c2.setLoc(new Location(100, 200));
		c3 = Customer.makeCustomer();
		c3.setLoc(new Location(200, 100));
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception
	{
	}

	@Before
	public void setUp() throws Exception
	{
	}

	@After
	public void tearDown() throws Exception
	{
	}

	@Test
	public void testCompare()
	{
		CustomerYComparator c = new CustomerYComparator();
		assertTrue(c.compare(c1, c2) < 0);
		assertTrue(c.compare(c2, c3) > 0);
		assertEquals(0, c.compare(c1, c3));
	}

}
